package com.jxk.jsonproject.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

public class User implements Serializable {

    private String name;
    private Integer age;
    private String city;
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")//这个是jackson的
    @JSONField(format = "yyyy-MM-dd HH-mm-ss") //这个是fastjson的
    private Date birth;

    public User() {
        super();
    }
    public User(String name, Integer age, String city, Date birth) {
        super();
        this.name = name;
        this.age = age;
        this.city = city;
        this.birth=birth;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getAge() {
        return age;
    }
    public void setAge(Integer age) {
        this.age = age;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }

    public Date getBirth() {
        return birth;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", city='" + city + '\'' +
                ", birth=" + birth +
                '}';
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }
}

